#!/usr/bin/env bash

FILE=big_pic

THEME=blood

sync() {
    git add -u && git commit -m '.' ;
        local branch=`git branch 2> /dev/null | sed -e '/^[^*]/d' |awk -F' ' '{print $2}'`
    git pull origin $branch && git push origin $branch;
}

PREFIX=$(realpath $(cd "$(dirname "$0")"; pwd))

XVCER=$PREFIX/../xvcer

cd $PREFIX

git add md/$FILE.md

pandoc -f markdown+pipe_tables -t revealjs -s -o $XVCER/html/$FILE.html $PREFIX/md/$FILE.md -V revealjs-url=https://cdn.bootcss.com/reveal.js/3.7.0 -V theme=$THEME --include-in-header md.css

cd $XVCER/html

open $FILE.html
git add $FILE.html

sync

cd $PREFIX

sync
